static char *snlen = NULL;
static char *snwhiteopt = NULL;
static char *deficon = NULL;
+/* Technically, even this is a little loose as spaces arent allowed */
+static char valid_waypt_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789";
static
arglist_t garmin_args[] = {
break;
}
+ if (global_opts.debug_level > 0) {
+ fprintf(stderr, "Waypoint type: %d\n"
+ "Chosen waypoint length %d\n",
+ gps_waypt_type, short_length);
+ }
/*
* If the user provided a short_length, override the calculated value.
*/
if (snwhiteopt)
setshort_whitespace_ok(mkshort_handle, atoi(snwhiteopt));
- /* Technically, even this is a little loose as spaces arent allowed */
- setshort_goodchars(mkshort_handle, "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789");
+ setshort_goodchars(mkshort_handle, valid_waypt_chars);
setshort_mustupper(mkshort_handle, 1);
}
nroutepts = GPS_Command_Get_Route(portname, &array);
- fprintf(stderr, "Routes %d\n", (int) nroutepts);
+// fprintf(stderr, "Routes %d\n", (int) nroutepts);
#if 1
for (i = 0; i < nroutepts; i++) {
route_head *rte_head;
if(wpt->description) src = wpt->description;
if(wpt->notes) src = wpt->notes;
- ident = global_opts.synthesize_shortnames ?
- mkshort(mkshort_handle, src) :
- wpt->shortname;
+ /*
+ * mkshort will do collision detection and namespace
+ * cleaning
+ */
+ ident = mkshort(mkshort_handle,
+ global_opts.synthesize_shortnames ? src :
+ wpt->shortname);
/* Should not be a strcpy as 'ident' isn't really a C string,
* but rather a garmin "fixed length" buffer that's padded
* to the end with spaces. So this is NOT (strlen+1).
*/
-fprintf(stderr, "%s\n", ident);
memcpy(way[i]->ident, ident, strlen(ident));
+
if (global_opts.synthesize_shortnames) {
xfree(ident);
}
queue *e, *t;
QUEUE_FOR_EACH(&hdr->namelist[i], e, t) {
uniq_shortname *s = (uniq_shortname *) e;
+#if 0
if (global_opts.verbose_status >= 2 && s->conflictctr) {
fprintf(stderr, "%d Output name conflicts: '%s'\n",
s->conflictctr, s->orig_shortname);
}
+#endif
dequeue(e);
xfree(s->orig_shortname);
xfree(s);
hdl->must_uniq = i;
}
-
char *
#ifdef DEBUG_MEM
MKSHORT(void *h, const char *istring, DEBUG_PARAMS )